﻿
namespace Indeco.G24.Windows.Forms
{
	/// <summary>
	/// abstract NhaCungCapLienHe typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class NhaCungCapLienHeDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<NhaCungCapLienHeDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.NhaCungCapLienHe _currentNhaCungCapLienHe = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxNhaCungCapLienHeDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxNhaCungCapLienHeErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxNhaCungCapLienHeBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the IDNhaCungCapLienHe property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDNhaCungCapLienHeDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDNhaCungCap property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDNhaCungCapDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the HoTen property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxHoTenDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Email property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxEmailDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DiaChi property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDiaChiDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the TieuDe property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxTieuDeDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the NoiDung property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNoiDungDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the ThoiDiemCapNhat property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxThoiDiemCapNhatDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.NhaCungCap> _IDNhaCungCapList;
		
		/// <summary> 
		/// The list of selectable NhaCungCap
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.NhaCungCap> IDNhaCungCapList
		{
			get {return this._IDNhaCungCapList;}
			set 
			{
				this._IDNhaCungCapList = value;
				this.uxIDNhaCungCapDataGridViewColumn.DataSource = null;
				this.uxIDNhaCungCapDataGridViewColumn.DataSource = this._IDNhaCungCapList;
			}
		}
		
		private bool _allowNewItemInIDNhaCungCapList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of NhaCungCap
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDNhaCungCapList
		{
			get { return _allowNewItemInIDNhaCungCapList;}
			set
			{
				this._allowNewItemInIDNhaCungCapList = value;
				this.uxIDNhaCungCapDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.NhaCungCapLienHe> _NhaCungCapLienHeList;
				
		/// <summary> 
		/// The list of NhaCungCapLienHe to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.NhaCungCapLienHe> NhaCungCapLienHeList
		{
			get {return this._NhaCungCapLienHeList;}
			set
			{
				this._NhaCungCapLienHeList = value;
				this.uxNhaCungCapLienHeBindingSource.DataSource = null;
				this.uxNhaCungCapLienHeBindingSource.DataSource = value;
				this.uxNhaCungCapLienHeDataGridView.DataSource = null;
				this.uxNhaCungCapLienHeDataGridView.DataSource = this.uxNhaCungCapLienHeBindingSource;				
				//this.uxNhaCungCapLienHeBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxNhaCungCapLienHeBindingSource_ListChanged);
				this.uxNhaCungCapLienHeBindingSource.CurrentItemChanged += new System.EventHandler(OnNhaCungCapLienHeBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnNhaCungCapLienHeBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentNhaCungCapLienHe = uxNhaCungCapLienHeBindingSource.Current as Entities.NhaCungCapLienHe;
			
			if (_currentNhaCungCapLienHe != null)
			{
				_currentNhaCungCapLienHe.Validate();
			}
			//_NhaCungCapLienHe.Validate();
			OnCurrentEntityChanged();
		}

		//void uxNhaCungCapLienHeBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.NhaCungCapLienHe"/> instance.
		/// </summary>
		public Entities.NhaCungCapLienHe SelectedNhaCungCapLienHe
		{
			get {return this._currentNhaCungCapLienHe;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxNhaCungCapLienHeDataGridView.VirtualMode;}
			set
			{
				this.uxNhaCungCapLienHeDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxNhaCungCapLienHeDataGridView.AllowUserToAddRows;}
			set {this.uxNhaCungCapLienHeDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxNhaCungCapLienHeDataGridView.AllowUserToDeleteRows;}
			set {this.uxNhaCungCapLienHeDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxNhaCungCapLienHeDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxNhaCungCapLienHeDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="NhaCungCapLienHeDataGridViewBase"/> class.
		/// </summary>
		public NhaCungCapLienHeDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxNhaCungCapLienHeDataGridView = new System.Windows.Forms.DataGridView();
			this.uxNhaCungCapLienHeBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxNhaCungCapLienHeErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDNhaCungCapLienHeDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDNhaCungCapDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxHoTenDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxEmailDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDiaChiDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxTieuDeDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNoiDungDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxThoiDiemCapNhatDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDNhaCungCapBindingSource = new NhaCungCapBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDNhaCungCapBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNhaCungCapLienHeDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNhaCungCapLienHeBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNhaCungCapLienHeErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxNhaCungCapLienHeErrorProvider
			// 
			this.uxNhaCungCapLienHeErrorProvider.ContainerControl = this;
			this.uxNhaCungCapLienHeErrorProvider.DataSource = this.uxNhaCungCapLienHeBindingSource;						
			// 
			// uxNhaCungCapLienHeDataGridView
			// 
			this.uxNhaCungCapLienHeDataGridView.AutoGenerateColumns = false;
			this.uxNhaCungCapLienHeDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxNhaCungCapLienHeDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDNhaCungCapLienHeDataGridViewColumn,
		this.uxIDNhaCungCapDataGridViewColumn,
		this.uxHoTenDataGridViewColumn,
		this.uxEmailDataGridViewColumn,
		this.uxDiaChiDataGridViewColumn,
		this.uxTieuDeDataGridViewColumn,
		this.uxNoiDungDataGridViewColumn,
		this.uxThoiDiemCapNhatDataGridViewColumn			});
			this.uxNhaCungCapLienHeDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxNhaCungCapLienHeDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxNhaCungCapLienHeDataGridView.Name = "uxNhaCungCapLienHeDataGridView";
			this.uxNhaCungCapLienHeDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxNhaCungCapLienHeDataGridView.TabIndex = 0;	
			this.uxNhaCungCapLienHeDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxNhaCungCapLienHeDataGridView.EnableHeadersVisualStyles = false;
			this.uxNhaCungCapLienHeDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnNhaCungCapLienHeDataGridViewDataError);
			this.uxNhaCungCapLienHeDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnNhaCungCapLienHeDataGridViewCellValueNeeded);
			this.uxNhaCungCapLienHeDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnNhaCungCapLienHeDataGridViewCellValuePushed);
			
			//
			// uxIDNhaCungCapLienHeDataGridViewColumn
			//
			this.uxIDNhaCungCapLienHeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDNhaCungCapLienHeDataGridViewColumn.DataPropertyName = "IDNhaCungCapLienHe";
			this.uxIDNhaCungCapLienHeDataGridViewColumn.HeaderText = "IDNhaCungCapLienHe";
			this.uxIDNhaCungCapLienHeDataGridViewColumn.Name = "uxIDNhaCungCapLienHeDataGridViewColumn";
			this.uxIDNhaCungCapLienHeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDNhaCungCapLienHeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDNhaCungCapLienHeDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDNhaCungCapDataGridViewColumn
			//
			this.uxIDNhaCungCapDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDNhaCungCapDataGridViewColumn.DataPropertyName = "IDNhaCungCap";
			this.uxIDNhaCungCapDataGridViewColumn.HeaderText = "IDNhaCungCap";
			this.uxIDNhaCungCapDataGridViewColumn.Name = "uxIDNhaCungCapDataGridViewColumn";
			this.uxIDNhaCungCapDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDNhaCungCapDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDNhaCungCapDataGridViewColumn.ReadOnly = false;		
			//
			// uxHoTenDataGridViewColumn
			//
			this.uxHoTenDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxHoTenDataGridViewColumn.DataPropertyName = "HoTen";
			this.uxHoTenDataGridViewColumn.HeaderText = "HoTen";
			this.uxHoTenDataGridViewColumn.Name = "uxHoTenDataGridViewColumn";
			this.uxHoTenDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxHoTenDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxHoTenDataGridViewColumn.ReadOnly = false;		
			//
			// uxEmailDataGridViewColumn
			//
			this.uxEmailDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxEmailDataGridViewColumn.DataPropertyName = "Email";
			this.uxEmailDataGridViewColumn.HeaderText = "Email";
			this.uxEmailDataGridViewColumn.Name = "uxEmailDataGridViewColumn";
			this.uxEmailDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxEmailDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxEmailDataGridViewColumn.ReadOnly = false;		
			//
			// uxDiaChiDataGridViewColumn
			//
			this.uxDiaChiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDiaChiDataGridViewColumn.DataPropertyName = "DiaChi";
			this.uxDiaChiDataGridViewColumn.HeaderText = "DiaChi";
			this.uxDiaChiDataGridViewColumn.Name = "uxDiaChiDataGridViewColumn";
			this.uxDiaChiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDiaChiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDiaChiDataGridViewColumn.ReadOnly = false;		
			//
			// uxTieuDeDataGridViewColumn
			//
			this.uxTieuDeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxTieuDeDataGridViewColumn.DataPropertyName = "TieuDe";
			this.uxTieuDeDataGridViewColumn.HeaderText = "TieuDe";
			this.uxTieuDeDataGridViewColumn.Name = "uxTieuDeDataGridViewColumn";
			this.uxTieuDeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxTieuDeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxTieuDeDataGridViewColumn.ReadOnly = false;		
			//
			// uxNoiDungDataGridViewColumn
			//
			this.uxNoiDungDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNoiDungDataGridViewColumn.DataPropertyName = "NoiDung";
			this.uxNoiDungDataGridViewColumn.HeaderText = "NoiDung";
			this.uxNoiDungDataGridViewColumn.Name = "uxNoiDungDataGridViewColumn";
			this.uxNoiDungDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNoiDungDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNoiDungDataGridViewColumn.ReadOnly = false;		
			//
			// uxThoiDiemCapNhatDataGridViewColumn
			//
			this.uxThoiDiemCapNhatDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxThoiDiemCapNhatDataGridViewColumn.DataPropertyName = "ThoiDiemCapNhat";
			this.uxThoiDiemCapNhatDataGridViewColumn.HeaderText = "ThoiDiemCapNhat";
			this.uxThoiDiemCapNhatDataGridViewColumn.Name = "uxThoiDiemCapNhatDataGridViewColumn";
			this.uxThoiDiemCapNhatDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxThoiDiemCapNhatDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxThoiDiemCapNhatDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDNhaCungCapDataGridViewColumn
			//				
			this.uxIDNhaCungCapDataGridViewColumn.DisplayMember = "NhaCungCap";	
			this.uxIDNhaCungCapDataGridViewColumn.ValueMember = "IDNhaCungCap";	
			this.uxIDNhaCungCapDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDNhaCungCapDataGridViewColumn.DataSource = uxIDNhaCungCapBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxNhaCungCapLienHeDataGridView);
			this.Name = "NhaCungCapLienHeDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDNhaCungCapBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNhaCungCapLienHeErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNhaCungCapLienHeDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNhaCungCapLienHeBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				NhaCungCapLienHeDataGridViewEventArgs args = new NhaCungCapLienHeDataGridViewEventArgs();
				args.NhaCungCapLienHe = _currentNhaCungCapLienHe;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class NhaCungCapLienHeDataGridViewEventArgs : System.EventArgs
		{
			private Entities.NhaCungCapLienHe	_NhaCungCapLienHe;
	
			/// <summary>
			/// the  Entities.NhaCungCapLienHe instance.
			/// </summary>
			public Entities.NhaCungCapLienHe NhaCungCapLienHe
			{
				get { return _NhaCungCapLienHe; }
				set { _NhaCungCapLienHe = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxNhaCungCapLienHeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnNhaCungCapLienHeDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxNhaCungCapLienHeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnNhaCungCapLienHeDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxNhaCungCapLienHeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDNhaCungCapLienHeDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].IDNhaCungCapLienHe;
						break;
					case "uxIDNhaCungCapDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].IDNhaCungCap;
						break;
					case "uxHoTenDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].HoTen;
						break;
					case "uxEmailDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].Email;
						break;
					case "uxDiaChiDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].DiaChi;
						break;
					case "uxTieuDeDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].TieuDe;
						break;
					case "uxNoiDungDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].NoiDung;
						break;
					case "uxThoiDiemCapNhatDataGridViewColumn":
						e.Value = NhaCungCapLienHeList[e.RowIndex].ThoiDiemCapNhat;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxNhaCungCapLienHeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnNhaCungCapLienHeDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxNhaCungCapLienHeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDNhaCungCapLienHeDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].IDNhaCungCapLienHe = (System.Guid)e.Value;
						break;
					case "uxIDNhaCungCapDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].IDNhaCungCap = (System.Guid)e.Value;
						break;
					case "uxHoTenDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].HoTen = (System.String)e.Value;
						break;
					case "uxEmailDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].Email = (System.String)e.Value;
						break;
					case "uxDiaChiDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].DiaChi = (System.String)e.Value;
						break;
					case "uxTieuDeDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].TieuDe = (System.String)e.Value;
						break;
					case "uxNoiDungDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].NoiDung = (System.String)e.Value;
						break;
					case "uxThoiDiemCapNhatDataGridViewColumn":
						NhaCungCapLienHeList[e.RowIndex].ThoiDiemCapNhat = (System.DateTime)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
